Adjust data types to get same results on 32- and 64-bit systems.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 24 Apr 2006 18:52:00 +0000 (18:52 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 24 Apr 2006 18:52:00 +0000 (18:52 +0000)
gpsbabel/an1.c

index 05e98048929152b51ec12b15d6aafb14cb8ddb41..c56806698577d1f6a8f63ff9b286889c5e7505ec 100644 (file)
@@ -22,6 +22,7 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
+#include <limits.h>
 
 #define MYNAME "an1"
 #include "defs.h"
@@ -205,14 +206,13 @@ Skip(FILE * f,
 static double
 DecodeOrd( long ord )
 {
-       return ((double)(long)(0x80000000L-ord))/(0x800000);
+       return (double)((gbint32)(0x80000000 - ord)) / 0x800000;
 }
 
 static long
 EncodeOrd( double ord )
 {
-       long tmp = ord * 0x800000;
-       return 0x80000000L-tmp;
+       return (gbint32)(0x80000000 - (gbint32)(ord * 0x800000));
 }
 
 static int